var Background = function()
{
	this.img = new Array();
	
	this.img[0] = new Image();
	this.img[0].src = "Images/Game_Tela1.jpg";
	
	this.img[1] = new Image();
	this.img[1].src = "Images/Game_Tela2.jpg";
	
	this.audio = new Array();
	
	this.audio[0] = new Image();
	this.audio[0].src = "Images/AudioOn.png";
	
	this.audio[1] = new Image();
	this.audio[1].src = "Images/AudioOFF_new.png"
	
	this.pause = new Array();
	
	this.pause[0] = new Image();
	this.pause[0].src = "Images/Pause.png";
	
	this.pause[1] = new Image();
	this.pause[1].src = "Images/Play.png"
	
	this.other = 0;
	this.count = 60;

	this.update = function()
	{
		this.other++;
		
		if(this.other > 1)
		{
			this.other = 0;
		}
	
		if(sceneManager.currentScene == "game")
		{
			this.count--;
		}
		
		if(sceneManager.currentScene != "game")
		{
			this.count = 60;
		}
	}
	
	this.draw = function()
	{
		graphics.DrawImage(this.img[this.other], 0, 0);
		graphics.DrawText("Tempo: " + this.count, 20, 30, "30px Myriad Pro", "White");
				
		if(!sceneManager.audio)
		{
			graphics.DrawImage(this.audio[1], 689, 545);
		}
		
		if(sceneManager.audio)
		{
			graphics.DrawImage(this.audio[0], 689, 545);
		}
		
		if(!sceneManager.pause)
		{
			sceneManager.loop = true;
			graphics.DrawImage(this.pause[0], 735, 545);
		}
		
		if(sceneManager.pause)
		{
			sceneManager.loop = false;
			graphics.DrawImage(this.pause[1], 735, 545);
		}
	}
}

var background = new Background();